package homework.homework1;

import java.util.Comparator;

public class StudentComparator implements Comparator {
    @Override
    public int compare(Object o1, Object o2) {
        Student first = (Student) o1;
        Student second = (Student) o2;

        if(first.getAge() > second.getAge()){
            return 1;
        }else if(first.getAge() == second.getAge()){
            if(first.getName() == "男")
                return -1;
        }else{
            return -1;
        }
        return 0;
    }
}
